<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>拉活</title>
<@fm.header />
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<form id="ff" method="post" enctype="multipart/form-data">
	    <table>
	        <tr>
	            <td><label for="brushId">拉活编号</label></td>
	            <td><input class="easyui-validatebox" type="text" name="brushId"  readonly="readonly" value=${config.brushId}></input></td>
	        </tr>
	         <tr>
	             <tr>
	            <td><label for="execTime">执行时间:</label></td>
	            <td><input type="text" class="easyui-datetimebox" id="execTime" name="execTime"  value=${config.execTime}></input></td>
	        </tr>


            <tr>
                <td><label for="brushTitle">标题</label></td>
                <td><input class="easyui-validatebox" type="text" name="brushTitle" style="width:400px" value="${config.brushTitle}"></input></td>
            </tr>

	        <tr>
	            <td><label for="url">链接:</label></td>
	            <td>
                    <input class="easyui-textbox" name="url" data-options="multiline:true;required:true;" style="width:400px;height:100px;" value="${config.url}" ></input>
				</td>
	        </tr>
	       <tr>
	           <td><label for="minTotal">日限最小值</label></td>
	            <td><input id="minTotal" type="text" style="width:400px" name="minTotal" id="minTotal" class="easyui-numberbox" min="0" precision="0" data-options="required:true" value=${config.minTotal}></input></td>
	        </tr>
	        
	        <tr>
	            <td><label for="maxTotal">日限最大值</label></td>
	            <td><input id="maxTotal" type="text" style="width:400px" name="maxTotal" id="maxTotal" class="easyui-numberbox" min="0" precision="0" data-options="required:true" value=${config.maxTotal}></input></td>
	        </tr>

            <tr>
                <td><label for="minFilterDay">最小间隔天</label></td>
                <td><input id="minFilterDay" type="text" style="width:400px" name="minFilterDay" class="easyui-numberbox" min="0" precision="0" data-options="required:true" value=${config.minFilterDay}></input></td>
            </tr>
            <tr>
                <td><label for="maxFilterDay">最大间隔天</label></td>
                <td><input id="maxFilterDay" type="text" style="width:400px" name="maxFilterDay" class="easyui-numberbox" min="0" precision="0" data-options="required:true" value=${config.maxFilterDay}></input></td>
            </tr>
	    </table>
	    </table>
	</form>
	</div>
	<div region="south" border="false" style="text-align: center; padding: 5px 5px 5px 0;">
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="edit()">提交</a>
	</div>
</div>

<script>

function edit() {
	
	$('#ff').form(
	    'submit',
	    {
			url : '/brushConfigTimer/saveConfig',
			onSubmit : function() {
				var minTotal = $("#minTotal").val();
				var maxTotal = $("#maxTotal").val();
				var str1 = parseFloat(minTotal);
				var str2 = parseFloat(maxTotal);
				if ( str1 > str2) {
				    top.showMsg(market.content.title, '最大小于最小值', alert);
					return false;
				}
			
				return $(this).form('enableValidation').form('validate');
			},
			success : function(data) {
				showProcess(false);
				var data = eval('(' + data + ')');
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				}else if(data.return_code == '10'){
					$.messager.alert(market.content.title, data.return_msg);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			},
			onLoadError : function() {
				showProcess(false);
				$.messager.alert(market.content.title, market.content.networkError);
			}
		}); 
}
</script>
</body>
</html>